#!/bin/bash
cd unpackage/dist/build/
npm run build
rm -rf dist.tar
tar -cvf dist.tar dist/*
scp -P 22 dist.tar root@8.138.232.82:/var/www/html/micro/sub-apps
ssh -p 22 -Tq root@8.138.232.82 << remotessh
rm -rf /var/www/html/micro/sub-apps/mes/*
cd /var/www/html/micro/sub-apps/mes/
mv /var/www/html/micro/sub-apps/dist.tar ./
tar -xvf dist.tar
mv ./dist/* ./
rm -rf dist.tar
rm -rf dist
exit
remotessh
